From: Xavier Johnson Date: Tue, 29 May 2018 04:27:22 +0000 (-0400) Subject: appDisplay: Make middle-click like Ctrl+click X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~929^2~5^2~44 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a21a22fdb58820864f6fe982b705150cb4a97ced;p=gnome-shell.git appDisplay: Make middle-click like Ctrl+click When middle-clicking an app icon on the Dash, it will always try to open a new window of that app, even if the app doesn't support multiple windows. Meanwhile, Ctrl+click on an app will only open a new window if the app allows it. This change prevents middle-clicks on app icons from opening new windows for apps without multi-window support. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/316 --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 2c4d2d1da..2835c2aae 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -1778,10 +1778,11 @@ var AppIcon = new Lang.Class({ activate(button) { let event = Clutter.get_current_event(); let modifiers = event ? event.get_state() : 0; - let openNewWindow = this.app.can_open_new_window () && - modifiers & Clutter.ModifierType.CONTROL_MASK && - this.app.state == Shell.AppState.RUNNING || - button && button == 2; + let isMiddleButton = button && button == Clutter.BUTTON_MIDDLE; + let isCtrlPressed = (modifiers & Clutter.ModifierType.CONTROL_MASK) != 0; + let openNewWindow = this.app.can_open_new_window() && + this.app.state == Shell.AppState.RUNNING && + (isCtrlPressed || isMiddleButton); if (this.app.state == Shell.AppState.STOPPED || openNewWindow) this.animateLaunch();